package com.caland.demo.business;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.caland.demo.business.dao.BlogDao;
import com.caland.demo.business.mapper.BlogMapper;


/**
 * {@link Service} with hard-coded input data.
 */
@Component
public class ExampleService implements Service {
	
	@Autowired
	BlogMapper blogMapper;
	
	@Autowired
	BlogDao blogDao;
	
	/**
	 * Reads next record from input
	 */
	public String getMessage() {
		return "Hello world!";	
	}
	
	public BlogMapper getBlogMapper(){
		return blogMapper;
	}

	public BlogDao getBlogDao() {
		return blogDao;
	}

	public Blog save(Blog blog){
		blogMapper.insert(blog);
		return blog;
	}
}
